package jp.co.rc.service.impl;

import jp.co.rc.entity.User;
import jp.co.rc.mapper.UserMapper;
import jp.co.rc.service.UserServiceI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserServiceI {

    @Autowired
    UserMapper userMapper;

    @Override
    public List<User> getAllUser() {
        return userMapper.getAllUser();
    }

    @Override
    public User getUserById(int id) {
        return userMapper.getUserById(id);
    }

    @Override
    public int createUser(User user) {
        return userMapper.createUser(user);
    }

    @Override
    public int deleteById(int id) {
        return userMapper.deleteById(id);
    }

    @Override
    public int updateById(String name, String password, String id) {
        return userMapper.updateById(name, password, id);
    }

    @Override
    public User getUserByData(String name, String password) {
        return userMapper.getUserByData(name, password);
    }
}
